package com.hdax.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.hdax.common.to.mq.StockLockTo;
import com.hdax.common.utils.PageUtils;
import com.hdax.gulimall.ware.entity.WareSkuEntity;
import com.hdax.gulimall.ware.vo.LockStockResult;
import com.hdax.gulimall.ware.vo.OrderTo;
import com.hdax.gulimall.ware.vo.SkuHasStockVo;
import com.hdax.gulimall.ware.vo.WareSkuLockVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author xiaohou
 * @email 2687781461@qq.com
 * @date 2023-04-08 23:42:59
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void andStock(Long skuId, Long wareId, Integer skuNum);


    List<SkuHasStockVo> getSkuHasStock(List<Long> skuIds);

   boolean orderLockStock(WareSkuLockVo wareSkuLockVo);


    void handleStockLockRelease(StockLockTo stockLockTo) throws JsonProcessingException;

    void handleStockLockRelease(OrderTo orderTo);
}

